package ar.view.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import ar.activity.R;

public class ShareChooseFriendAdapter extends BaseAdapter {

	private Context context;
	private ArrayList<String> srcNames = new ArrayList<String>();
	private ArrayList<String> srcNumbers = new ArrayList<String>();

	public void setSrcNames(ArrayList<String> srcNames) {
		this.srcNames = srcNames;
	}

	public void setSrcNumbers(ArrayList<String> srcNumbers) {
		this.srcNumbers = srcNumbers;
	}

	public ShareChooseFriendAdapter(Context context) {
		super();
		this.context = context;
	}

	@Override
	public int getCount() {
		return srcNames.size();
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		LayoutInflater inflater = (LayoutInflater) this.context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.share_choose_friend_item,
				parent, false);
		TextView tvMain = (TextView) rowView
				.findViewById(R.id.tvShareChooseFriendMain);
		TextView tvSub = (TextView) rowView
				.findViewById(R.id.tvShareChooseFriendSub);

		tvMain.setText(srcNames.get(position));
		tvSub.setText(srcNumbers.get(position));
		return rowView;
	}

}
